home *** CD-ROM | disk | FTP | other *** search
- Path: newspost1.alt.net!usenet
- From: Larry Buller <ljbuller@mail.btigate.com>
- Newsgroups: comp.lang.c++
- Subject: Global Variables
- Date: 9 Feb 1996 03:34:14 GMT
- Organization: AltNet - Affordable Usenet Access - http://www.alt.net
- Message-ID: <4fefbm$dhf@tofu.alt.net>
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.22KIT (Windows; U; 16bit)
-
- Help!!! I'm using visualc++ 4.0. What I want to do is recall information
- from an ini file... I already know how to do that. What I can't seem to
- figure out is how to reference global variables in other classes. For
- instance I can declare a variable outside of functions and class and That
- is supposed to make it global. If I delcare x in 1.h and define it in
- 1.cpp then try to refer to x in 2.cpp I get an undeclared variable error.
- If I make sure the declaration also exists in the 2.h, then I get a linker
- error. I know this has got to be a real simple answer, but I'll be darned
- if I can find the answer. Any body got help for this soul lost in c++
- hell? Larry Buller
-
-